﻿using BLL;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace UnitTestVipProject
{

    [TestClass]
    public class ArticleUT
    {
        ManagePage mym = new ManagePage();
        ArticleService bll = new ArticleService();

        [TestMethod]
        public void AddArticleTM()
        {
            ps_article model = new ps_article();

            model.title = "AddArticleTM";
            model.content = "AddArticleTM";
            model.add_time = Utils.StrToDateTime("2021-12-15");
            model.sort_id = 1;
            Assert.IsTrue(bll.AddArticle(model, false, model.title));
        }

        [TestMethod()]
        public void UpdateArticleTM()
        {
            ps_article model = new ps_article();
            model.GetModel(12);

            model.title = "AddArticleTM";
            model.content = "AddArticleTM";
            model.add_time = Utils.StrToDateTime("2021-12-15");
            model.sort_id = 1;

            Assert.IsTrue(bll.UpdateArticle(false, model, false, model.title));
        }

    }
}
